<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2023/5/5
  Time: 8:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Register</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/employee">
    员工姓名: <input type="text" name="ename"><br>
    员工性别:
    <input type="radio" name="egendar" value="1" id="man"><label for="man">男</label>
    <input type="radio" name="egendar" value="0" id="woman"><label for="woman">女</label><br>
    部门名称:
    <select id="choose-dep" name="depid">
        <option value="">--请选择你的部门--</option>
        <option value="1">总经理办公室</option>
        <option value="2">人力资源部</option>
        <option value="3">财务部</option>
        <option value="4">生产技术部</option>
        <option value="5">计划营销部</option>
        <option value="6">安全监察部</option>
        <option value="7">后勤部</option>
    </select>
    <input type="text" name="act" value="register" style="display: none">
    <button>提交</button><button type="reset">重置</button>
</form>
<button onclick="window.location.href='${pageContext.request.contextPath}/home.jsp'">返回主界面</button>
</body>
<script>
    const flag = '<%=request.getParameter("flag")%>';
    if(flag=="false"){
        alert("添加员工信息失败!");
    }
</script>
</html>
